<?php
$this->load->view("header");
?>
<div id="main_content">
<div class="titlebar"><?= $title;?></div>
<!--The following table is for detailed book information-->
<?php
$this->load->view("bookdetail");
?>
<div class="homepage_mid_column">
<div class="book_charts_noborder" style="width:400px">
<div class="book_chart_title">出售这本书的人：</div>
<table class="chart_listing_preview">
<tbody>
<?php
if($salepost==null){
  echo "暂时没有人出售这本书。";
}
else{
  foreach($salepost as $salepost){?>
  <table id="book_item" cellspacing="0" cellpadding="0" class="BookItem" onmouseover="this.style.background = &quot;#f2f3f4&quot;;" onmouseout="this.style.background = &quot;#ffffff&quot;;" >
  <tbody>
  <tr class="tr-margin"><td></tr>
  <tr>
    <td valign="top" align="left">
        <table class="BookInfo" cellspacing="0" cellpadding="0" width="100&percnt;">
        <tbody><tr><td class="title"  align="left" style="font-size:13px"><a href="<?=site_url()?>/bookiki/enterShop?id=<?=$salepost->user_id?>&go=yes" name="landingpagelink"><?=$salepost->user_id?></a></td></tr>
        <tr><td class="tracks" colspan="10" align="left" style="font-size:12px">要价:￥<?=$salepost->price?>&nbsp;&nbsp;&nbsp;成色:<?php switch($salepost->quality) {case 1: echo "较旧";break; case 2: echo "半新";break; case 3: echo "基本全新";break; case 4: echo "全新";break; }?>
         <?php $content=urlencode($salepost->book_title);
                   $receiver=urlencode($salepost->user_id);
        ?>
        <a href="<?=site_url()?>/user/edit_msg?<?=htmlentities("content=".$content."&type=wanted&receiver=".$receiver)?>">站短</a>
         </td></tr>
         </tbody></table>
    </td>
   </tr>
   </tbody>
   </table>

<?php
 } //end of foreach
} //end of else
?>
</tbody>
</table>
</div><!--book_charts中间偏左的排行榜-->

<div class="book_charts" style="width:400px">
<div class="book_chart_title">求购这本书的人：</div>
<table class="chart_listing_preview">
<tbody>
<?php
if($wantedpost==null){
  echo "暂时没有人求购这本二手书。";
}
else{
  foreach($wantedpost as $wantedpost){?>
  <table id="book_item" cellspacing="0" cellpadding="0" class="BookItem" onmouseover="this.style.background = &quot;#f2f3f4&quot;;" onmouseout="this.style.background = &quot;#ffffff&quot;;" >
  <tbody>
  <tr class="tr-margin"><td></tr>
  <tr>
    <td valign="top" align="left">
        <table class="BookInfo" cellspacing="0" cellpadding="0" width="100&percnt;">
        <tbody><tr><td class="title"  align="left" style="font-size:13px"><a href="<?=site_url()?>/bookiki/enterShop?id=<?=$wantedpost->user_id?>&go=yes" name="landingpagelink"><?=$wantedpost->user_id?></a></td></tr>
        <tr><td class="tracks" colspan="10" align="left" style="font-size:12px">可接受价格：￥<?=$wantedpost->start_price?>-￥<?=$wantedpost->end_price?>&nbsp;&nbsp;
        <?php $content=urlencode($wantedpost->book_title);
                   $receiver=urlencode($wantedpost->user_id);
        ?>
        <a href="<?=site_url()?>/user/edit_msg?content=<?=$content?>&type=sale&receiver=<?=$receiver?>&go=yes">站短</a>
        </td></tr>
         </tbody>
         </table>
    </td>
   </tr>
   </tbody>
   </table>

<?php
 } //end of foreach
} //end of else
?>
</tbody>
</table>
</div><!--book_charts中间偏左的排行榜-->

</div><!--homepage_mid_column-->


<?php
$this->load->view("footer");
?>